package com.qin.mall.openfeign.order;

import com.qin.mall.common.api.CommonResult;
import com.qin.mall.common.api.MyBatisPlusPage;
import com.qin.mall.domain.OmsOrderReturnReason;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 订单原因管理远程调用
 * @author Leisure
 * create 2022 2022/11/22 8:50
 **/
@FeignClient("order-manage")
public interface OmsOrderReturnReasonFeigin {

    /**
     *添加订单原因
     */
    @PostMapping("/Reason/create")
    public CommonResult create(@RequestBody OmsOrderReturnReason returnReason);

    /**
     * 修改退货原因
     */
    @PostMapping("/Reason/update/{id}")
    public CommonResult update(@PathVariable Long id,
                         @RequestBody OmsOrderReturnReason returnReason);

    /**
     * 批量删除退货原因
     */
    @PostMapping("/Reason/delete")
    public CommonResult delete(@RequestParam("ids") List<Long> ids);

    /**
     * 分页获取退货原因
     */
    @GetMapping("/Reason/list")
    @ResponseBody
    public CommonResult<MyBatisPlusPage<OmsOrderReturnReason>> list(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                                                                    @RequestParam(value = "pageSize",defaultValue = "5") Integer pageSize);

    /**
     * 批量修改退货原因状态
     */
    @PostMapping("/Reason/update/status")
    public CommonResult updateStatus(@RequestParam("status") Integer status,
                                     @RequestParam("ids") List<Long> ids);

    /**
     * 获取单个退货原因详情信息
     */
    @GetMapping("/Reason/{id}")
    public CommonResult<OmsOrderReturnReason> getItem(@PathVariable Long id);

}
